set(TARGET Core)
set(BOX_API_TARGET BoxApiLib)

configure_file(
	${CMAKE_CURRENT_SOURCE_DIR}/Version.h_tmpl
	${CMAKE_CURRENT_SOURCE_DIR}/Version.h
)

# Adding Core sublibraries
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Detail)

set(CORE_SOURCES 
	${CORE_SOURCES}	
	${CMAKE_CURRENT_SOURCE_DIR}/Proto/CoreProtocol.pb.cc
	${CMAKE_CURRENT_SOURCE_DIR}/Box/BoxInstance.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/Box/BoxAsioTransportImpl.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/Commands.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/DefaultCommandScheduler.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/SearchEngine/MapKeyValueStorage.cpp 
	${CMAKE_CURRENT_SOURCE_DIR}/SearchEngine/SearchEngine.cpp
	)

set(BOX_API_SOURCES
	${CMAKE_CURRENT_SOURCE_DIR}/BoxApi/ApiManager.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/BoxApi/AsioBoxConnectionImpl.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/Commands.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/Proto/CoreProtocol.pb.cc
	)

# Create Core static library 
add_library(${TARGET} STATIC ${CORE_SOURCES}) 
add_dependencies(${TARGET} Common)

# Create BoxApi static library
add_library(${BOX_API_TARGET} STATIC ${BOX_API_SOURCES})
add_dependencies(${BOX_API_TARGET} Common)

